/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.controller;

import queenb.web.util.SessionProvider;
import queenb.web.util.Util;

/**
 *
 * @author Nguyen Hung
 */
public class menuSettingController extends QueenbController {
    private int stepmenu = 1000;
    private int tip =1;


    public menuSettingController() {
        Object typeObject = getRequest().getParameter("type");
        try {
            if (typeObject != null) {
                tip = Util.parseInt(typeObject);
                SessionProvider.setSessionMapValue("type", tip);
               
            }
        } catch (Exception e) {
        }
        
         Object typeObject1 = getRequest().getParameter("stepmenu");
        try {
            if (typeObject1 != null) {
                stepmenu = Util.parseInt(typeObject1);
                SessionProvider.setSessionMapValue("stepmenu", stepmenu);
               
            }
            
            System.out.println("menu-------Active-----"+stepmenu);
        } catch (Exception e) {
        }

    }

    /**
     * @return the tip
     */
    public int getTip() {
        if(SessionProvider.getSessionMapValue("type")!= null){
            tip = Integer.parseInt(SessionProvider.getSessionMapValue("type").toString());
        }
        return tip;
    }

    /**
     * @param tip the tip to set
     */
    public void setTip(int tip) {
        this.tip = tip;
    }

    /**
     * @return the stepmenu
     */
    public int getStepmenu() {
        if(SessionProvider.getSessionMapValue("stepmenu")!= null){
            stepmenu = Integer.parseInt(SessionProvider.getSessionMapValue("stepmenu").toString());
        }
        return stepmenu;
    }

    /**
     * @param stepmenu the stepmenu to set
     */
    public void setStepmenu(int stepmenu) {
        this.stepmenu = stepmenu;
    }

}
